<!--Richiamabile con:
	http://fcaliumi.web.cs.unibo.it/pw/test/caio-wip/Caio-ProvaResponseHandler.xhtml
	http://cayodev.homelinux.com/pholivichi/html/ltw0807/test/caio-wip/Caio-ProvaResponseHandler.xhtml
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://www.w3.org/MarkUp/SCHEMA/xhtml11.xsd"
	xml:lang="en" >
	<head>
		<title>Prova di mergificazione gestione e parodizzazione dei responses</title>
		
		<script type = "text/javascript" src = "../../ac/globalVariables.js"/>
		<script type = "text/javascript" src = "../../ac/catalogFunctions.js"/>
		<script type = "text/javascript" src = "../../ac/dataSourceFunctions.js"/>
		<script type = "text/javascript" src = "../../ac/dataFormatterFunctions.js"/>
		<script type = "text/javascript" src = "../../ac/mainFunctions.js"/>
		<script type = "text/javascript" src = "../../ac/postFunctions.js"/>
		<script type = "text/javascript" src = "../../ac/loadFunctions.js"/>
		<script type = "text/javascript" src = "../../ac/queryFunction.js"/>
		<script type = "text/javascript" src = "../../ac/formatFunctions.js"/>
		<script type = "text/javascript" src = "../../ac/xsltFunctions.js"/>
		<script type = "text/javascript" src = "../../al/ResponseHandler.js"/>
		<script type = "text/javascript" src = "../../ac/appendinoFunctions.js"/>
		<!--<script type = "text/javascript" src = "../../../mootools-1.2-core.js"/>
		-->
	
		<script type = "text/javascript">
			//<![CDATA[
			
			function main(){
				
				ds[0] = new DataSource (crescentina);
				ds[1] = new DataSource (sDiIntDS);
				ds[2] = new DataSource (ferrazzDS);
				ds[3] = new DataSource (cataDS);
				
				var onRespComplete = 
					function(thisResp)
					{
						putOnScreen(thisResp.getWindow(1),'frammento1');
						putText("Operazione conclusa... Risposte ottenute: " + thisResp.getResNum(),'comunicazioni');
						
 						df[0] = new DataFormatter (piadina);
 						ser=new XMLSerializer();
 						fc= new FormattaCreator(false);
 				
 						domTemp=thisResp.getWindow(0);
 						domTemp.getElementsByTagName('response')[0];						
 						fc.add(domTemp);
 				 		richiestaFormatta=fc.getDOM();
						risultato=df[0].formatDocument(richiestaFormatta);	
						appendino(risultato);
						
						df[1]=new DataFormatter(tigella);
						fc = new FormattaCreator(false);
						domTemp=thisResp.getWindow(0);
 						domTemp.getElementsByTagName('response')[0];
						fc.add(domTemp);
						richiestaFormatta=fc.getDOM();
						risultato=df[1].formatPDF(richiestaFormatta);
					};
				var responseHandler = new ResponseHandler(ds.length);
				responseHandler.onready = onRespComplete;				

				for (var i=0; i<ds.length; i++)
				{
					ds[i].query("folksonomia[0]=PD",
						null,
						function(xhr)
						{
							responseHandler.addSource(xhr.responseXML);
						},
						function(xhr)
						{
							alert("DS query: errore " + xhr.status);
						});
				}
			}
			
			
			//]]>
		</script>
	</head>
	<body onload="main()">
		<div id="comunicazioni" />
		<div id="cornice" />
	</body>
</html>
